//package com.ruoyi.flowable.listener;
//
//import com.ruoyi.common.core.domain.entity.SysUser;
//import lombok.extern.slf4j.Slf4j;
//import org.flowable.engine.delegate.DelegateExecution;
//import org.flowable.engine.delegate.ExecutionListener;
//import org.flowable.engine.delegate.TaskListener;
//import org.flowable.engine.impl.el.FixedValue;
//import org.flowable.task.service.delegate.DelegateTask;
//import org.flowable.variable.api.persistence.entity.VariableInstance;
//import org.springframework.stereotype.Component;
//
///**
// * 用户任务监听器
// *
// * @author KonBAI
// * @since 2023/5/13
// */
//@Component(value = "userTaskListener")
//@Slf4j
//public class UserTaskListener implements ExecutionListener {
//
//    /**
//     * 注入字段（名称与流程设计时字段名称一致）
//     */
//     private FixedValue userId;
//
//
////    @Override
////    public void notify(DelegateTask delegateTask) {
////        //TODO 实现你的任务监听器逻辑
////        System.out.println("执行任务监听器...");
//////        SysUser sysUser = new SysUser();
//////        sysUser.setUserId(Long.getLong(userId.getExpressionText()));
//////        sysUser.setUserType("1");
//////        userService.updateUser(sysUser);
////        log.info("执行了UserTaskListener。。。{}", delegateTask);
////        log.info("--------执行了UserTaskListener。。。{}", userId);
////    }
//
//    @Override
//    public void notify(DelegateExecution delegateExecution) {
//        log.debug("执行了UserTaskListener。。。{}", delegateExecution);
//        log.debug("--------执行了UserTaskListener。。。{}", userId);
//       // String userId = delegateExecution.getVariableInstance("field101").getValue().toString();
//        System.out.println("执行了UserTaskListener。。。" + delegateExecution);
//        System.out.println("--------执行了UserTaskListener。。。{}。。。" + userId);
//    }
//
//}
